/**
 * Multicast project Bidois Morgan & Thomas Nunes
 *
 */
package middleware;

import Engine.Message;
import Engine.TypeMessage;
import java.nio.channels.SocketChannel;

/**
 *
 * @author thomas
 */
public interface I_RecvMulticastHandler {

    /**
     * callback called when an entire message has been received
     */
    public void receivedCB(Message message, SocketChannel socket);

    /**
     * Notify that a client is dead
     *
     * @param idClient the id of the dead client
     * @param socketChannel the socketChannel of the dead client
     */
    public void notifyAClientIsAFK(int idClient, SocketChannel socketChannel);

    /**
     * Send a message to all clients
     *
     * @param data the content
     * @param type the type of message
     */
    public void send2All(byte[] data, TypeMessage type);

    /**
     * Remove a client by his socket
     *
     * @param localSocketChannel the socket of the client
     */
    public void removeBySocket(SocketChannel localSocketChannel);

    /**
     * Add a socket to a client
     *
     * @param localSocketChannel the socket to add
     */
    public void putSocket(SocketChannel localSocketChannel);
}
